<?php
header ('Content-type: text/html; charset=utf-8');
	$str ="<img src = '/contents/xxx' />sdaกดฟหกวดสฟห หฟกฟหก่าส กฟดหกดาสฟกพห<img src ='/contents/asdasdasd' />";
	$p = '/contents/';
	$r = 'http://'.$_SERVER["HTTP_HOST"].'/contents/';
	echo str_replace($p,$r ,$str);
	exit;
?>